CentOS 7
Sponsored Link

DRBD : Install
2016/01/27
 
Install DRBD (Distributed Replicated Block Device) to configure Distributed Storage System.
This example is based on the environment like follows.
+----------------------+          |          +----------------------+
| [   DRBD Server#1  ] |10.0.0.51 | 10.0.0.52| [   DRBD Server#2  ] |
|   node01.srv.world   +----------+----------+   node02.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

It's necessarry the server you'd like to install DRBD has free block-device.
This example shows to configure to use a block-device "/dev/vg_r0/lv_r0".
[1] Update system & install required packages first and reboot on both Hosts.
[root@node01 ~]#
yum -y update

[root@node01 ~]#
yum -y install gcc make automake autoconf libxslt libxslt-devel flex rpm-build kernel-devel

[root@node01 ~]#
[2]
Install DRBD on both Hosts.
Make sure the latest DRBD and download it on the site below.
⇒ http://oss.linbit.com/drbd/
By the way, drbd-km package is built with the current version of kernel, so if you will update kernel in the future, then you need to re-build DRBD again with the version of kernel.
[root@node01 ~]#
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

[root@node01 ~]#
wget http://oss.linbit.com/drbd/drbd-utils-latest.tar.gz \
http://oss.linbit.com/drbd/8.4/drbd-8.4.7-1.tar.gz
[root@node01 ~]#
tar zxvf drbd-8.4.7-1.tar.gz

[root@node01 ~]#
cd drbd-*

[root@node01 drbd-8.4.7-1]#
make km-rpm

[root@node01 drbd-8.4.7-1]#
[root@node01 ~]#
tar zxvf drbd-utils-latest.tar.gz

[root@node01 ~]#
cd drbd-utils-*

[root@node01 drbd-utils-8.9.5]#
vi drbd.spec.in
# near line 34: add the line

%bcond_without sbinsymlinks
%undefine with_sbinsymlinks
[root@node01 drbd-utils-8.9.5]#
./configure

[root@node01 drbd-utils-8.9.5]#
make rpm

[root@node01 drbd-utils-8.9.5]#
cd /root/rpmbuild/RPMS/x86_64
[root@node01 x86_64]#
rpm -Uvh drbd-utils-*.rpm drbd-km-*.rpm

Preparing...                          ################################# [100%]
Updating / installing...
   1:drbd-utils-8.9.5-1.el7.centos    ################################# [ 33%]
   2:drbd-km-3.10.0_327.4.5.el7.x86_64################################# [ 67%]
   3:drbd-km-debuginfo-8.4.7-1        ################################# [100%]
 
Tweet